package org.jactao.cluster.loadbalance;

import org.jactao.common.LException;
import org.jactao.rpc.LChannel;

import java.util.List;

/**
 * Created by fanzetao on 2018/4/10.
 */
public abstract class LSelector {

    public static LSelector get(String loadBalance) {
        switch (loadBalance) {
            case "random":
                return new LRandomSelector();
            default:
                throw new LException(loadBalance + " loadBalance not support");
        }
    }

    public abstract LChannel select(List<LChannel> channels);
}
